/***************************************************************************
 *   Copyright (C) 2007 by Alexandre Masselot,,,   *
 *   alex@alex-laptop   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this program; if not, write to the                 *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef BOLSCORERECORDER_H
#define BOLSCORERECORDER_H

#include "metascore.h"
#include "hasmetascore.h"

namespace bol {

/**
  pure virtual class to record MetaScore instances, typically fo further renormalization.
  It can be derived as  a object recording all values, a given number of values or just sum s and sum of s²
 * All score or HasScore object added to the recorder must have the same MetaScoreDescriptor
 * The first recorded  

  @author Alexandre Masselot,GeneBio,http://www.genebio.com, <alexandre.masselot@gmail.com>
 */
  class ScoreRecorder{
    private:
      MetaScoreDescriptor const* m_descriptor;
    public:
      ScoreRecorder();

      ~ScoreRecorder();

      /**
       * virtual function that will implement the action 
       * @param score 
       */
      virtual void addImpl(const MetaScorePtr& score)=0;

      /**
       * add a score to be recorded
       * @param score 
       */
      void add(const MetaScorePtr& score);

      /**
       * add an object with a MetaScore
       * @param hasScore 
       */
      void add(const HasMetaScore& hasScore){
        add(hasScore.score());
      }
  };

}

#endif
